]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
recorder: Hide cursor while magnifier is active
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 22 May 2013 15:48:56 +0000 (17:48 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 22 May 2013 16:33:16 +0000 (18:33 +0200)
The magnifier adds its own copy of the system cursor to apply the
expected transformations, so we don't need to add it again in the
recorder; this avoids two different cursors showing up in recordings,
but doesn't address the case where the cursor should not be recorded
at all, but the magnifier adds it anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=700488

src/shell-recorder.c

index 8d84a7ac1c6398859cfb5a8d6089ebb56372d87d..eb0d44748447bbb156e311a0ccf78c372d5905a6 100644 (file)
@@ -25,6 +25,9 @@
 /* This is also hard-coded in mutter and GDK */
 #define VIRTUAL_CORE_POINTER_ID 2
 
+#define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications"
+#define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled"
+
 typedef enum {
   RECORDER_STATE_CLOSED,
   RECORDER_STATE_RECORDING
@@ -68,6 +71,7 @@ struct _ShellRecorder {
 
   CoglHandle recording_icon; /* icon shown while playing */
 
+  GSettings *a11y_settings;
   gboolean draw_cursor;
   cairo_surface_t *cursor_image;
   int cursor_hot_x;
@@ -277,6 +281,8 @@ shell_recorder_init (ShellRecorder *recorder)
   recorder->recording_icon = create_recording_icon ();
   recorder->memory_target = get_memory_target();
 
+  recorder->a11y_settings = g_settings_new (A11Y_APPS_SCHEMA);
+
   recorder->state = RECORDER_STATE_CLOSED;
   recorder->framerate = DEFAULT_FRAMES_PER_SECOND;
   recorder->draw_cursor = TRUE;
@@ -299,6 +305,8 @@ shell_recorder_finalize (GObject  *object)
 
   cogl_handle_unref (recorder->recording_icon);
 
+  g_clear_object (&recorder->a11y_settings);
+
   G_OBJECT_CLASS (shell_recorder_parent_class)->finalize (object);
 }
 
@@ -580,7 +588,8 @@ recorder_record_frame (ShellRecorder *recorder)
 
   GST_BUFFER_PTS(buffer) = now - recorder->start_time;
 
-  if (recorder->draw_cursor)
+  if (recorder->draw_cursor &&
+      !g_settings_get_boolean (recorder->a11y_settings, MAGNIFIER_ACTIVE_KEY))
     recorder_draw_cursor (recorder, buffer);
 
   shell_recorder_src_add_buffer (SHELL_RECORDER_SRC (recorder->current_pipeline->src), buffer);